<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type="text/css" href="bogstyle.css" rel="stylesheet" media="screen" />
<title>BOG - Best Online Games</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php include 'functions.php'; ?>
</head>
<?php
$spieler_name = $_REQUEST['spieler_name'];
$game = $_REQUEST['game'];
$punkte = $_REQUEST['punkte'];
$c = $_REQUEST['c'];
//wenn highscoredaten gepostet sind füge sie hinzu
if($game && $spieler_name && $punkte) add_highscore($game,trim(strip_tags($spieler_name)),$punkte);
else if($game && $spieler_name && $c) add_decoded_highscore($game,trim(strip_tags($spieler_name)),$c);
?>
<body>
<div id="container">
<div id="banner"><?php show_banner(); ?></div>
<div id="left"><?php show_navi(); ?></div>
<div id="content"><?php
if($game){
	echo "Highscores<br>Game: ".$game."<br>------------------------------------";
	$result = get_highscore($game);
	echo "<table align=\"center\" cellpadding=0 cellspacing=0>";
	for($i=0;$highscore = mysql_fetch_object($result);$i++){
		if($i==0) echo "<tr style=\"background-color:gold;font-size:130%\"><td style=\"border-right-width:thin;border-right-style:solid;border-right-color:black\">".($i+1).".</td><td style=\"border-right-width:thin;border-right-style:solid;border-right-color:black\">".$highscore->spieler_name."</td><td>".$highscore->punkte."</td></tr>";
		if($i==1) echo "<tr style=\"background-color:silver;font-size:120%\"><td style=\"border-right-width:thin;border-right-style:solid;border-right-color:black\">".($i+1).".</td><td style=\"border-right-width:thin;border-right-style:solid;border-right-color:black\">".$highscore->spieler_name."</td><td>".$highscore->punkte."</td></tr>";
		if($i==2) echo "<tr style=\"background-color:#D76B00;font-size:110%\"><td style=\"border-right-width:thin;border-right-style:solid;border-right-color:black\">".($i+1).".</td><td style=\"border-right-width:thin;border-right-style:solid;border-right-color:black\">".$highscore->spieler_name."</td><td>".$highscore->punkte."</td></tr>";
		if($i>2)  echo "<tr><td style=\"border-right-width:thin;border-right-style:solid;border-right-color:black\">".($i+1).".</td><td style=\"border-right-width:thin;border-right-style:solid;border-right-color:black\">".$highscore->spieler_name."</td><td>".$highscore->punkte."</td></tr>";
	}
}else{

	echo "Game auswählen:<br>--------------------------<br>";
	$result = get_games();
	echo "<table align=\"center\">";
	for($i=0;$spiel = mysql_fetch_object($result);$i++){
		echo "<tr><td><a href=\"highscores.php?game=".$spiel->game."\">".$spiel->game."</a></td></tr>";
	}
}
echo "</table>";
?></div>
<div id="right"></div>
<div id="footer">BOG - Nur die besten OnlineGames</div>
</div>
</body>
</html>
